import { addData, deleteById, listData, pageData, updateById } from '@/services/base-request';
import { API, DynamicObject, PageParams } from '@/services/typings';
import { ParamsType } from '@ant-design/pro-components';

export const pageSettingAPI = (params: ParamsType) => {
  return pageData('/sysSetting', params);
};

export const addSettingAPI = (data: API.ISetting) => {
  return addData('/sysSetting', data);
};

export const updateSettingAPI = (data: API.ISetting) => {
  return updateById('/sysSetting', data);
};

export const deleteSettingAPI = (id: string | number) => {
  return deleteById('/sysSetting', id);
};

export const pageSettingGroupAPI = (params: PageParams, options?: DynamicObject) => {
  return pageData('/sysSettingGroup', params, options);
};

export const listSettingGroupAPI = (params: PageParams, options?: DynamicObject) => {
  return listData('/sysSettingGroup', params, options);
};
export const addSettingGroupAPI = (data: API.ISettingGroup, options?: DynamicObject) => {
  return addData('/sysSettingGroup', data, options);
};

export const updateSettingGroupAPI = (data: API.ISettingGroup, options?: DynamicObject) => {
  return updateById('/sysSettingGroup', data, options);
};

export const deleteSettingGroupAPI = (id: string, options?: DynamicObject) => {
  return deleteById('/sysSettingGroup', id, options);
};
